<template>
	<view class="item-style" :style="{'border-bottom':bottomCom}">
		<view class="input-type">{{typeMsg}}</view>
		<input :style="{'width':'400rpx','height':'100rpx'}" @input="setInputValue" :placeholder="emptyMsg" />
	</view>
</template>

<script>
	export default {
		props: {
			typeMsg: {
				type: String,
				default: ''
			},
			isLast: {
				type: Boolean,
				default: false
			},
			isEmpty: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				inputValue: '',
				emptyMsg: this.isEmpty ? '请输入' + this.typeMsg : ''
			}
		},
		methods: {
			setInputValue(e) {
				this.inputValue = e.detail.value
				this.$emit('getValue', this.inputValue)
			}
		},
		computed: {
			bottomCom() {
				if (this.isLast) {
					return "solid 1rpx #666666"
				} else {
					return ""
				}
			}
		}
	}
</script>

<style>
	.input-type {
		display: flex;
		flex-direction: column;
		margin-left: 50rpx;
		justify-content: center;
		height: 100rpx;
		width: 200rpx;
	}

	.item-style {
		display: flex;
		justify-content: center;
		background-color: #FFFFFF;
		border: solid 1rpx #666666;
		border-bottom: 0;
	}
</style>
